#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);getchar(); 
    while(n!=0)
    {
        long long i=0,j=0,len,k,temp;
        int flag=1,count=1;
        k=temp=2*n;
        j=k%10;
        while(flag)
        {
			count=1; 
            while(temp)
            {
                if(j!=temp%10)
                {
                	if((++count)>2)
                		break;
                	j=temp%10;
				}
                temp/=10;
            }
            if(count==2)
            {
            	printf("%d: %lld\n",n,k);
            	break;
			}
            temp=k+=n;
			j=k%10; 
        }
        scanf("%d",&n);getchar();
    }
    return 0;
}
